<?php
$name = $_POST['uname'];
$pass = $_POST['upass'];
$id  =  $_POST['uid'];

$link = mysqli_connect('localhost','root','root','test');

$res = mysqli_query($link,"INSERT INTO  `user`  (`username`,`password`,`id`)  VALUES('$name','$pass','$id') ");

if($res){
  // 如果成功 给一个信息
  $arr = array('message' => '注册成功', 'code' => 1 );
}else{
  // 如果失败  给一个信息
  $arr = array('message' => '注册失败' , 'code' => 0 ) ;
};
print_r(json_encode($arr));
?>